//------------------------------------------------------------------------------------
#ifndef __CSNAKE_H__
#define __CSNAKE_H__
//------------------------------------------------------------------------------------
#include <QList>
#include <QHash>
#include "CSnakeHead.h"
#include "CSnakeBody.h"
//------------------------------------------------------------------------------------
class CSnake {
    public:
        CSnake(int len);
        ~CSnake(void);
        void draw(QPainter *painter, int idxImage);
        void incLen(void);
        int getLen(void) { return body->size()+1; }
        void setPosition(QPoint position);
        void next(void);
        void setIncX(int incX);
        void setIncY(int incY);
        bool onCell(int index);
        int getIndex(void);
        int getIncX(void) { return head->getIncX(); }
        int getIncY(void) { return head->getIncY(); }
        bool onBody(void);
    private:
        CSnakeHead *head;
        QList<CSnakeBody *> *body;
};
//------------------------------------------------------------------------------------
#endif //__CSNAKE_H__
//------------------------------------------------------------------------------------
